3.1.1 \(\int \frac {a+b \log (c x^n)}{d+e x+f x^2} \, dx\) [1]

Optimal. Leaf size=173 \[ \frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}+\frac {b n \text {Li}_2\left (-\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {b n \text {Li}_2\left (-\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}} \]

[Out]

(a+b*ln(c*x^n))*ln(1+2*f*x/(e-(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)-(a+b*ln(c*x^n))*ln(1+2*f*x/(e+(-4*d*f+e^
2)^(1/2)))/(-4*d*f+e^2)^(1/2)+b*n*polylog(2,-2*f*x/(e-(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)-b*n*polylog(2,-2
*f*x/(e+(-4*d*f+e^2)^(1/2)))/(-4*d*f+e^2)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.13, antiderivative size = 173, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {2404, 2354, 2438} \begin {gather*} \frac {b n \text {PolyLog}\left (2,-\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {b n \text {PolyLog}\left (2,-\frac {2 f x}{\sqrt {e^2-4 d f}+e}\right )}{\sqrt {e^2-4 d f}}+\frac {\log \left (\frac {2 f x}{e-\sqrt {e^2-4 d f}}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f}}-\frac {\log \left (\frac {2 f x}{\sqrt {e^2-4 d f}+e}+1\right ) \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(a + b*Log[c*x^n])/(d + e*x + f*x^2),x]

[Out]

((a + b*Log[c*x^n])*Log[1 + (2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f] - ((a + b*Log[c*x^n])*Log[1 +
(2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f] + (b*n*PolyLog[2, (-2*f*x)/(e - Sqrt[e^2 - 4*d*f])])/Sqrt[
e^2 - 4*d*f] - (b*n*PolyLog[2, (-2*f*x)/(e + Sqrt[e^2 - 4*d*f])])/Sqrt[e^2 - 4*d*f]

Rule 2354

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)/((d_) + (e_.)*(x_)), x_Symbol] :> Simp[Log[1 + e*(x/d)]*((a +
b*Log[c*x^n])^p/e), x] - Dist[b*n*(p/e), Int[Log[1 + e*(x/d)]*((a + b*Log[c*x^n])^(p - 1)/x), x], x] /; FreeQ[
{a, b, c, d, e, n}, x] && IGtQ[p, 0]

Rule 2404

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.)*(RFx_), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*Log[c*x^
n])^p, RFx, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, n}, x] && RationalFunctionQ[RFx, x] && IGtQ[p, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rubi steps

\begin {align*} \int \frac {a+b \log \left (c x^n\right )}{d+e x+f x^2} \, dx &=\int \left (\frac {2 f \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f} \left (e-\sqrt {e^2-4 d f}+2 f x\right )}-\frac {2 f \left (a+b \log \left (c x^n\right )\right )}{\sqrt {e^2-4 d f} \left (e+\sqrt {e^2-4 d f}+2 f x\right )}\right ) \, dx\\ &=\frac {(2 f) \int \frac {a+b \log \left (c x^n\right )}{e-\sqrt {e^2-4 d f}+2 f x} \, dx}{\sqrt {e^2-4 d f}}-\frac {(2 f) \int \frac {a+b \log \left (c x^n\right )}{e+\sqrt {e^2-4 d f}+2 f x} \, dx}{\sqrt {e^2-4 d f}}\\ &=\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {(b n) \int \frac {\log \left (1+\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{x} \, dx}{\sqrt {e^2-4 d f}}+\frac {(b n) \int \frac {\log \left (1+\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{x} \, dx}{\sqrt {e^2-4 d f}}\\ &=\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {\left (a+b \log \left (c x^n\right )\right ) \log \left (1+\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}+\frac {b n \text {Li}_2\left (-\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}-\frac {b n \text {Li}_2\left (-\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )}{\sqrt {e^2-4 d f}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.18, size = 173, normalized size = 1.00 \begin {gather*} \frac {2 \tan ^{-1}\left (\frac {e+2 f x}{\sqrt {-e^2+4 d f}}\right ) \left (a-b n \log (x)+b \log \left (c x^n\right )\right )}{\sqrt {-e^2+4 d f}}+\frac {b n \left (\log (x) \left (\log \left (1+\frac {2 f x}{e-\sqrt {e^2-4 d f}}\right )-\log \left (1+\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )\right )+\text {Li}_2\left (\frac {2 f x}{-e+\sqrt {e^2-4 d f}}\right )-\text {Li}_2\left (-\frac {2 f x}{e+\sqrt {e^2-4 d f}}\right )\right )}{\sqrt {e^2-4 d f}} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Log[c*x^n])/(d + e*x + f*x^2),x]

[Out]

(2*ArcTan[(e + 2*f*x)/Sqrt[-e^2 + 4*d*f]]*(a - b*n*Log[x] + b*Log[c*x^n]))/Sqrt[-e^2 + 4*d*f] + (b*n*(Log[x]*(
Log[1 + (2*f*x)/(e - Sqrt[e^2 - 4*d*f])] - Log[1 + (2*f*x)/(e + Sqrt[e^2 - 4*d*f])]) + PolyLog[2, (2*f*x)/(-e
+ Sqrt[e^2 - 4*d*f])] - PolyLog[2, (-2*f*x)/(e + Sqrt[e^2 - 4*d*f])]))/Sqrt[e^2 - 4*d*f]

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 4.
time = 0.24, size = 555, normalized size = 3.21

method result size
risch \(-\frac {2 b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) n \ln \left (x \right )}{\sqrt {4 d f -e^{2}}}+\frac {2 b \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) \ln \left (x^{n}\right )}{\sqrt {4 d f -e^{2}}}+\frac {b n \ln \left (x \right ) \ln \left (\frac {-2 f x +\sqrt {-4 d f +e^{2}}-e}{-e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}-\frac {b n \ln \left (x \right ) \ln \left (\frac {2 f x +\sqrt {-4 d f +e^{2}}+e}{e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}+\frac {b n \dilog \left (\frac {-2 f x +\sqrt {-4 d f +e^{2}}-e}{-e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}-\frac {b n \dilog \left (\frac {2 f x +\sqrt {-4 d f +e^{2}}+e}{e +\sqrt {-4 d f +e^{2}}}\right )}{\sqrt {-4 d f +e^{2}}}-\frac {i \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )}{\sqrt {4 d f -e^{2}}}+\frac {i \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) b \pi \,\mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}}{\sqrt {4 d f -e^{2}}}+\frac {i \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) b \pi \,\mathrm {csgn}\left (i x^{n}\right ) \mathrm {csgn}\left (i c \,x^{n}\right )^{2}}{\sqrt {4 d f -e^{2}}}-\frac {i \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{3}}{\sqrt {4 d f -e^{2}}}+\frac {2 \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right ) b \ln \left (c \right )}{\sqrt {4 d f -e^{2}}}+\frac {2 a \arctan \left (\frac {2 f x +e}{\sqrt {4 d f -e^{2}}}\right )}{\sqrt {4 d f -e^{2}}}\) \(555\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*ln(c*x^n))/(f*x^2+e*x+d),x,method=_RETURNVERBOSE)

[Out]

-2*b/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*n*ln(x)+2*b/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d
*f-e^2)^(1/2))*ln(x^n)+b*n/(-4*d*f+e^2)^(1/2)*ln(x)*ln((-2*f*x+(-4*d*f+e^2)^(1/2)-e)/(-e+(-4*d*f+e^2)^(1/2)))-
b*n/(-4*d*f+e^2)^(1/2)*ln(x)*ln((2*f*x+(-4*d*f+e^2)^(1/2)+e)/(e+(-4*d*f+e^2)^(1/2)))+b*n/(-4*d*f+e^2)^(1/2)*di
log((-2*f*x+(-4*d*f+e^2)^(1/2)-e)/(-e+(-4*d*f+e^2)^(1/2)))-b*n/(-4*d*f+e^2)^(1/2)*dilog((2*f*x+(-4*d*f+e^2)^(1
/2)+e)/(e+(-4*d*f+e^2)^(1/2)))-I/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*c)*csgn(I*x
^n)*csgn(I*c*x^n)+I/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*c)*csgn(I*c*x^n)^2+I/(4*
d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*x^n)*csgn(I*c*x^n)^2-I/(4*d*f-e^2)^(1/2)*arctan
((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*Pi*csgn(I*c*x^n)^3+2/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))*b*l
n(c)+2*a/(4*d*f-e^2)^(1/2)*arctan((2*f*x+e)/(4*d*f-e^2)^(1/2))

________________________________________________________________________________________

Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="maxima")

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*d*f-%e^2>0)', see `assume?`
for more det

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="fricas")

[Out]

integral((b*log(c*x^n) + a)/(f*x^2 + x*e + d), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {a + b \log {\left (c x^{n} \right )}}{d + e x + f x^{2}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*ln(c*x**n))/(f*x**2+e*x+d),x)

[Out]

Integral((a + b*log(c*x**n))/(d + e*x + f*x**2), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*log(c*x^n))/(f*x^2+e*x+d),x, algorithm="giac")

[Out]

integrate((b*log(c*x^n) + a)/(f*x^2 + x*e + d), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {a+b\,\ln \left (c\,x^n\right )}{f\,x^2+e\,x+d} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*log(c*x^n))/(d + e*x + f*x^2),x)

[Out]

int((a + b*log(c*x^n))/(d + e*x + f*x^2), x)

________________________________________________________________________________________